6. generic device 6

上一课我们看到,可以使用哪些条件来检测通用设备中的故障?
And the last lesson we saw, what are the conditions that can be used to detect faults in a generic device?

所以现在我们将尝试实现这一点,并将在活塞队的示例中进行测试。
So right now we will try to implement this and we will test this on the Pistons examples.

因此,我们需要 FBI 的实际输出,以便能够在功能块之外实际传递此信息。
So we would need an actual output for the FBI in order to be able to actually deliver this information outside the function block.

因此,我们将创建另一个 Numerati 类型,可用于实际描述正在发生的故障类型。
So we will create another Numerati type that can be used to actually describe the type of fault that is happening.

让我们进入数据类型文件夹。
So let's go into the data types folder.

添加一个单元类型和枚举,我们将其称为新的 Enuma 设备。
Add in that in that a unit type and enumeration and let's call this a new Enuma device for.

让我们再次删除限定的 only 属性,并开始编写可能的思想类型的可能配置,在没有发生故障的情况下,我们将有足够的无故障可能性。
Let's again remove the qualified only attribute and let's start writing the possible configuration of possible kinds of thought, we would have enough No-Fault possibility where no fault is occurring.

假设这等于零。
Let's say this is equal to zero.

启用的反馈传感器可能有故障。
We can have a fault on the enabled feedback sensor.

因此启用反馈折叠并且该值应等于 10。
So enable feedback fold and this shall be equal to 10.

我们可能会在禁用反馈方面遇到错误。
We can have a fault on a disable feedback.

那么让我们看看。
So let's see.

我们需要可见的反馈故障,并且该值应等于 20。
We need both visible feedback fault and this shall be equal to 20.

最后,正如我们所说,这仅适用于双反馈设备。
And lastly, for this to, as we said, are only for double feedback devices.

最后一种是执行器故障,仅针对双反馈装置和单反馈装置。
And the last one is the actuator fault again, only for double feedback devices and for single feedback devices.

正如我们在之前的视频中所说,我们无法区分传感器故障还是执行器故障。
As we said in the previous videos, we are not able to distinguish if we had a sensor fault or an actuator fault.

因此,我们将在这里写另一个附加故障,该故障应为等于 40 的通用故障。
So we will write over here another additional fault that shall be generic fault equal to 40.

在我们的通用设备 SFB 中,我们需要另一个输出来实际将此信息带到外部。
And in our generic device, SFB, we will need another output that will actually bring this information outside.

因此我们将添加该设备进行输出,类型为任意设备故障。
So we will add this device for output and the type shall be any device fault.

我们需要根据反馈类型实际感受该输出的价值。
And we will need to actually feel the value of this of this output according to the feedback type.

根据我们在上一个视频中找到的表格,该设备启用和禁用传感器。
And the device enables sensor and disable sensor, according to the table that we found out in the in the last video.

因此,接下来,我们将编写完整检测的代码。
So moving on here, we will write the code for the full detection.

所以我会在这里发表另一条评论说“马驹检测”。
So I will had another comment over here saying foaled detection.

我们将简单地按照我们在上一个视频中定义的方式写入该表的代码,因此我们将执行案例操作,我们将查看设备的反馈类型,并且我们将对无反馈做出不同的考虑。
And we will simply writing to code that table the way we defined in the last video, so we will carry out a case operation and we will look at the feedback type of the device and we will make different consideration for the no feedback.

对于单反馈设备启用反馈设备,对于单反馈设备禁用反馈设备并允许双反馈设备。
Devices for single enable feedback devices for the single disable feedback devices and allows for the double feedback devices.

因此,从最初的开始,如果我们不结束任何反馈,我们将无法检测到任何故障,因此我们只需将设备设置为可行等于无故障。
So starting from the initial one, if we don't end any feedback, we won't be able to detect any fault, so we will simply set the device for viable equal to not fault.

那么如果我们处于单一启用反馈状态,我们有不同的配置来找出故障。
Then if we are in the single enabled feedback, we have different configurations to find out a fault.

首先,如果我们愿意的话,我们将会遇到这样的情况。
So first of all, we will then have the case in which we have, if we will, right here.

如果表中的第一种情况是设备状态等于禁用。
If the first case of the table is if we have the device state equal to disabled.

我们没有设备反馈,因此状态等于禁用而不是设备。
And we have the we don't have the device feedback, so and the states equal to disable and not the device.

禁用传感器,很抱歉,我将在这里删除这个括号,这是我们的第一个条件,我们在这里或在下一行。
Disabled senser, so sorry, I will remove this bracket over here and this is our first condition, we're right or over here and go in the next line.

这是正确的。
That's right.

一切都对齐了。
Everything aligned.

这是第一个。
So this was the first one.

第二个处于启用状态启用它。
The second one was in the enabling state enabling it.

那么状态就等于启用,而我们却没有。
So is the state is equal to enabling and we don't have it.

抱歉,我们实际上,呃,我们处于启用状态,并且我们仍然有设备禁用的传感器。
Sorry, we actually, uh, we are in the enabling state and we have still the device disabled sensor.

我们还需要考虑超时时间。
And also we need to look at the time out.

这是我们的第二个配置。
This is our second configuration.

第三个是当我们的设备状态等于启用构建而我们没有,我们仍然让设备禁用传感器。
Our third one is when we have the device state equal to enable building and we don't, we still have the device disable sensors.

所以我们最正确的就是这样。
So we rightest like this.

或者最后一个处于禁用状态,因此如果我们的状态等于禁用,并且我们没有设备禁用传感器,并且我们还有超时。
Or the last one is in the disabling state, so if we have the state equal to disabling and we don't have the device disabled sensor and also we have a timeout.

所以这意味着我们的设备没有及时激活。
So this means that we the device didn't activate in time.

他们及时启动了。
They activated in time.

因此,如果我们有这种情况,我们的设备故障将等于我们的一般故障。
So if we have this condition, our device fault will be equal to our generic fault.

由于我们无法区分是否有任何这种情况,所以我们会说我们有,我们没有任何过错。
Since we are not able to distinguish alse if we don't have any of this condition, we will say that we have we don't have any fault.

没有错。
No fault.

好的,这又是我们的单一启用反馈设备的内容,在这里,我们将为有关单一启用反馈的人们编写相同的内容。
OK, so this is it for our single enabled feedback device again, over here, we will write the same thing for the people regarding the single enable feedback.

抱歉,这里是关于单只蜜蜂能够反馈过来的,好吧。
Sorry, this one over here was about the single bees able feed back and over here, all right.

对于单个使能反馈。
For the single enable feedback.

因此,根据表,如果我们在不同状态下平等禁用,则单个启用反馈将导致故障,如果我们没有启用反馈,则双状态等于禁用且设备启用传感器或。
So the single enable feedback will lead to a fault, according to the table, if we have in the diverse state equality disabled, if we don't if we have the enable feedback so the bi state equal to disabled and device enabled senser or.

在启用状态逐个状态中,等于启用,并且我们没有设备启用传感器并且我们有超时,或者我们只是将表重写为 COSO 或者状态等于启用并且我们没有启用传感器。
In the enabling state by state, equal to enabling, and we don't have the device enabled sensor and we have a timeout or we are simply rewriting the table into COSO or the state is equal to enabled and we don't have the enable sensor.

或者最后一种情况是当我们的设备状态等于禁用时,我们仍然拥有设备启用的传感器和超时。
Or the last case is when we have the device state equal to disabled and we still have the device enabled sensor and the time out.

话又说回来,在这里我们有一个设备折叠,它等于一般故障,否则我们就没有任何故障。
Then again, over here we have a device fold that is equal to the generic fault or else we don't have any fault.

所以设备故障就等于没有故障。
So device fault is equal to no fault.

因此,我们设法为单个反馈、单个可见反馈和单个启用反馈编写完整配置。
So we managed to write the full configuration for our single feedback and single visible feedback and single enabled feedback.

现在,让我们继续讨论双重反馈。
So right now, let's move on to the double feedback.

在这里,我们有很多这些的组合。
And over here, we have quite a few combinations of these.

那么我们就从禁用反馈故障开始吧。
So let's start from the disabled feedback fault.

因此,让我们在这里,如果我们处于禁用状态,我们就会遇到禁用反馈故障。
So let's right over here, we have a disabled feedback fault if we are in the disabled state.

那么我们来写吧。
So let's write.

如果 VI 状态等于禁用并且我们没有它,则设备既不会禁用传感器,也不会设备启用传感器。
If the VI state is equal to disabled and we don't have it, neither the device disabled sensor nor and not the device enable the sensor or.

同样,我们在启用状态中形成了可见的反馈。
Again, we have had visible feedback formed in the enable status.

因此,如果副状态相等,则启用三个传感器,并且我们将激活两个传感器。
So if the vice state is equal, three enabled and we have both sensors activated.

因此,如果我们有设备可见传感器和设备启用传感器。
So if we have a device visible sensor and device enabled sensor.

我们有这个错误,或者最后一个错误是当我们处于禁用状态时,该状态等于禁用,而我们没有设法做到这一点,它实际上禁用了反馈。
We have this fault or the last one is when we are in the disabling state, the state is equal to disabling and we are not managing to have and it actually disabled the feedback.

所以我们有一个设备,而不是设备禁用的传感器和非设备启用的传感器。
So we have a device and not the device disabled sensor and the not device enabled sensor.

超时,因为这是表中橙色空间中的橙色之一,好的,在这种情况下,我们的设备折叠等于 Decebal 反馈。
And the time out, because this is one of the orange of the orange spaces in the table, OK, in this case we will have our device fold equal to a Decebal feedback for.

所以我们涵盖了三种不同的可能状态之一,这是一张照片,所以我们就在这里安全,我们将寻找其他类型的故障。
So we covered one of three different possible states, this is a photo, so we were right over here as safe and we will look for other kinds of faults.

因此,首先,我们将研究与我们所写的第一个类似的下降。
So first, we will look into the analagous fall to the first one we wrote.

因此,我们将寻找启用的反馈故障,以便在状态需要时我们可以获得有意义的反馈故障,等于启用。
So we will look for the enabled feedback fault so we can have a meaningful feedback fault if we are needed by state, equal to enabled.

我们已经激活了两个传感器。
And we have both sensors activated.

所以我们是对的。
So we were right.

以及设备禁用的传感器和设备启用的传感器。
And device disabled sensors and device enabled sensor.

这是第一个配置,或者我们有另一个处于启用状态的配置。
This is the first configuration or we have another configuration in the enabling state.

所以如果状态是平等的。
So if the state is equal.

到。
To.

启用。
Enabling.

一眨眼,我们既没有传感器,也没有一个传感器,所以也没有设备,禁用传感器,而不是设备启用传感器和超时。
In the blink, and we have neither sensor, not one sensor, so and not the device, disable the sensor and not device enabled the sensor and the time out.

然后,当我们处于等于启用的状态时,我们对最后的钱包可能性感到抱歉,并且我们实际上没有激活任何一个传感器,因此设备禁用传感器,并且没有设备启用传感器。
Then sorry for the last pursey possibilities when we are in that state equal to enabled and we actually have neither of the sensor activated, so the device disable sensor and no device enabled the sensor to then.

正确的。
Right.

设备故障相当于使能反馈故障。
The device fault is equal to enable feedback fault.

好的,最后一个是执行器故障,所以我们写得好像我们实际上有四种可能性,而总错误的可能性是状态。
OK, so the last one is the actuator fault, so we write as if we have actually four possibilities for the total false one for which is the state.

所以第一个,如果状态等于禁用,并且我们没有设备禁用传感器,但我们有设备启用传感器,或者如果我们有,我们处于设备状态等于两个启用,我们实际上只有设备禁用反馈。
So the first one, if the state is equal to disabled and we have we don't have the device disabled sensor and we have the device enabled sensor or if we have the we are in the device state equals two enabling and we actually only have the device disabled feedback.

所以设备禁用了传感器而不是。
So device disabled sensor and not.

对不起。
Sorry.

在这里。
Over here.

对,那是正确的。
Yes, that's correct.

设备启用的传感器。
Device enabled sensor.

或者,如果我们的设备状态等于已启用,并且我们只有。
Or if we are in the device state equal to enabled and we have only the.

信任设备已禁用传感器的可见反馈,以及设备未启用传感器或最后一个是当我们的设备状态等于禁用时,我们很抱歉我错过了这里的超时。
Visible feedback to trust device disabled sensors and the not that device enabled the sensor or the last one is when we have the device state equal to disabling and we have sorry I missed over here a time out.

所以我们在这里并暂停。
So we're here and time out.

如果我们在处于禁用状态时转到这里,我们希望设备禁用传感器,但我们将有一个设备启用传感器。
If we go over here when we are in the disabling state, we want to have the device disabled sensor, but we will have a device enabled the sensor.

那么在这种情况下,我们将有一个称为执行器故障的设备。
Then in this case we will have a device called equal to, uh, actuator fault.

否则如果我们不具备这些条件,我们就不会有任何设备,就等于没有故障。
Or else if we don't have any of these conditions, we won't have any device for it is equal to no fault.

好吧,这写起来相当复杂。
OK, this was pretty complicated to write.

什么表对此很有帮助。
What the table is very helpful for this.

所以我们只需要仔细检查一下,看看这个文字与桌子上写的内容是否一致。
So we just need to double check and see if this writing is coherent with what was what was written on the table.

但这只是一个机械的任务,把所有的东西都写下来。
But this was simply a mechanical task to write everything.

我的意思是,呃,结构化文本。
I mean, uh, structured text.

因此,在这种情况下,通过这种方式,我们实际上让设备管理完整的检测,这样我们就可以返回这里并升级这个功能块,所有这些都是为了让设备也向外折叠。
So in this case, in this way, we actually have the device managing a full detection so we can go back here and upgrade this, the function block, all in order to have also the device fold outward.

因此,如果我单击更新参数,右键单击并在每次调用功能块时更新参数,您将看到弹出的新输出。
So if I click on update parameters, right, click and update parameters on every call of the function blocks, you will see a new output popping up.

在全局变量列表中,我让这个活塞设备为每个活塞折叠一个。
And in the global variable lists, I had this piston device fold one for each piston.

所以我们将能够在可视化上看到实际结果。
So we will be able to see the actual result on the visualization.

所以我会在这里写活塞。
So I will go over here and write the piston.

一台设备呼叫。
One device called.

我将复制它并更改每个人的数量,将活塞改为副污垢活塞三倍。
And I will copy it and changing the number for each person, piston to the vice fouled piston three fold.

您可以和我一起做,也可以直接跳过并自己做。
You can do it with me or simply skip ahead and do it on your own.

活塞为.
Piston for.

活塞五.
Piston five.

贝斯顿六号和活塞七号。
Beston six and Piston's seven.

好的,我们可以尝试构建该程序。
OK, so we can try and build the program.

我们没有英雄,所以我们可以上网尝试这个程序。
We have no heroes and so we can go online and try this program.

所以让我们在这里上网,下载所有东西,模拟环境。
So let's go online over here, download everything, the simulation environment.

那么让我们开始并回到我们实际已经测试过的可视化。
So let's start and go back to the visualization we actually already tested.

如果活塞工作正常,我们可以再试一次,看看在误检测之前是否有任何误报。
If the Pistons are working correctly, we can try it again to see if we don't have any false positive before the false detection.

也就是说,您可以在这里看到故障没有发出。
That is, you can see here the fault is not getting issued.

所以在第一个中,我们无法对活塞做任何事情,即完全检测,因为我们没有任何传感器。
So in the first one, we cannot do anything about the the piston, the full detection because we don't have any sensors.

让我们继续这里的第二个。
Let's move on to the second one over here.

我们可以尝试做不同的事情。
We could try and do different things.

例如,让我们将初始反馈强制设置为错误,这意味着我们永远不会收到该传感器的通过。
For instance, let's force the initial feedback to false meaning that we won't ever receive this sensor going through.

让我们尝试启用此功能。
And let's try to enable this.

我们可以看到这里有问题,那里有问题。
We can see over here that we have a fault over there.

这只是可视化,如果我们在这里再试一次,我们实际上会在这个按钮上看到一般错误。
And there was simply the visualization, and if we try again over here, we'll actually see generic fault over here on the on this button.

因此,如果我们没有反馈,如果我再次移除此力,我们将能够看到这种故障,否则我们将看不到任何故障,让我们尝试强制进给通过。
So if we don't have the feedback, we will be able to see this kind of fault if I am to remove this force again or we will see no fault, let's try to force the feed to through.

如果我再次禁用活塞,我将遇到一般故障。
If I disable the piston again, I will have a generic fault.

我可以做的另一种测试是强制激活通过。
Another kind of test I can do is to force the activation to through.

实际上,我们将再次看到一般故障,并且在禁用时启用传感器。
We will actually see generic fault again and also by enabling the sensors when we are disabled.

一般故障,这里同样有效。
Generic fault, the same works over here.

我们将在激活时、设备上的 Beston 上触发一般故障。
We will trigger generic faults on the on the activate, on the Beston on the device.

现在有许多不同的可能性,让我们尝试第四种,因为我们有反馈,例如,如果我禁用,我删除禁用反馈,如果我强制启用反馈,他将在这里读取反馈故障。
With many different possibilities now, let's try on the fourth one, because we have the feedback and if, for instance, I disable, I remove the disable feedback, he will read over here the feedback fault if I force the enabled feedback.

在这里,我们有一个条件,即不会产生任何故障。
Over here, we have a conditions that that is not generating any fault.

我们可以简单地进入设备,因为这应该被覆盖。
We could simply go into the device because this should be covered.

因此,让我们单击通用设备。
So let's click on the generic device.

因此,我们正在关注 Pistone,因为我们处于这种情况。
So we are looking at Pistone for we are in this case.

正如你所看到的,我在这里犯了一个错误。
And as you can see, I made a mistake over here.

所以我们实际上需要在这里,残疾人。
So we I would actually need to right over here, disabled.

我会启用三次。
I would enable three times.

所以如果我离线的话。
So if I go offline and if.

这些恶人。
These evil.

我们上网吧。
Let's go online.

让我们回到线上吧。
Let's go back online.

在活塞上的可视化中,在这里,您可以看到反馈故障,因为我正在强制它,我移除了力,我可以尝试移除活塞并强制它强制启用反馈故障。
Into the visualisations onto Pistone, for here, you can see in the feedback fault, because I'm forcing it, I remove the force, I can try removing the piston and forcing this to force the enable feedback fault.

那是对的。
That is correct.

让我们尝试强制执行此操作。
Let's try to force this to force.

再说一次,这个错误,这是正确的,如果它试图强制启动,首先我会看到能够反馈保持。
Again, this fault, this is correct, if it tries to force the actuation, at first I will see able feedback hold.

但最后,正如你所看到的,我们得到了一个执行器来再次发生这种情况。
But in the end, as you can see, we get an actuator for this occurs again.

如果我。
If I.

将此设置为强制,我们也可以尝试其他的,但它们实际上是相同的,因为传感器是相同的,并且它们的工作方式完全相同。
Place this to force and we can also try the other ones, but they are actually the same because the sensors are the same and they work exactly in the same way.

正如您所看到的,我们实际上能够通过简单的功能检测所有这些类型的故障,例如查看状态和设备,呃,反馈传感器。
So as you can see, we are actually able to detect all of these kinds of fault with the simple function, like looking at the state and the device, uh, feedback sensors.

我们以非常紧凑的方式开发了它。
And we developed this in a very compact way.

这是。
It is.

它很短。
It is very short.

代码不到300行。
There are less than 300 lines of codes.

在我看来,它按功能划分很容易阅读。
It is very divided by divided by functionalities is easy to read, in my opinion.

这个周末,它非常非常灵活,我们可以实现多种设备。
And with this weekend, it is very, very flexible and we can implement many kinds of devices.

所以现在,在下一个视频中,我们将带来这个功能块。
So right now, in the next video, we will bring this function block.

我们将复制通用设备文件夹的所有内容。
We will copy all the content of our generic device folder.

我们将把它放在我们的项目中,我们将在我们的机器的开发中使用通用设备。
We will place it in our projects and we will use the generic device in the development of our machine.